package com.nopay.cdxphone.ui.adapter;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.nopay.cdxphone.bean.response.GetCallTaskGroupResponse;

import java.util.List;

import com.nopay.cdxphone.R;

/**
 * @ProjectName: guizhou_assets
 * @Package: dhc.guizhou.assets.view.adapter
 * @ClassName: TollAdapter
 * @Description: 外呼
 * @Author: Kawaii's cat
 * @CreateDate: 2020-6-2 11:13
 * @UpdateUser: 更新者：
 * @UpdateDate: 2020-6-2 11:13
 * @UpdateRemark: 更新说明：
 * @Version: 1.0
 */
public class CallTaskGroupAdapter extends BaseQuickAdapter<GetCallTaskGroupResponse.Data, BaseViewHolder> {

    public CallTaskGroupAdapter(@Nullable List<GetCallTaskGroupResponse.Data> data) {
        super(R.layout.adapter_call_task_group, data);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, GetCallTaskGroupResponse.Data bean) {
        helper.setText(R.id.tv_task_name, bean.getTaskName());
        helper.setText(R.id.tv_create_time, bean.getCreateTime());
        helper.setText(R.id.tv_already, "已拨打：" + bean.getCalledNum() + "/" + bean.getCallAllNum());
        helper.setText(R.id.tv_times, "接通率：" + Math.round(bean.getConnected() * 100) + "%");
        helper.addOnClickListener(R.id.layout_call_task_group_item);
        helper.addOnLongClickListener(R.id.layout_call_task_group_item);
    }

}